#编写时间:2022-10-24
#编写人:付学瑞
import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop020_商品管理商品属性删除属性"
groupname="好好学习"
shuxingname="天天向上"

firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,"商品管理","商品属性","属性")
# 1.点击“删除”按钮，确定删除，删除成功。
time.sleep(1)
firefox.find_element_by_link_text("删除").click()
time.sleep(2)
firefox.switch_to_alert().accept()

#断言
try:
    firefox.find_element_by_xpath("//td[text()='%s']"%groupname).is_displayed()
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)
firefox.quit()

